<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="../../../js/plugins/layui-v2.4.5/layui/css/layui.css" />
		<link rel="stylesheet" href="../../../css/reset.css" />
		<link rel="stylesheet" href="../../../css/list.css" />
	</head>
	<body class="p10">
		<div class="container p15">
			<div class="btn-container"><a href="javascript:;" id="addBtn" class="layui-btn layui-btn-sm">添加</a></div>
			<table id="list" lay-filter="list"></table>
		</div>
		<script src="../../../js/jquery-3.3.1.min.js"></script>
		<script src="../../../js/plugins/layui-v2.4.5/layui/layui.js"></script>
		<script src="../../../js/common.js"></script>
		<script>
			var data = [{"created":"2018-08-27","creater":"admin","folderid":"001","foldername":"富地大厦租务部","id":"aaa69b81d3e747dc973a7cb6a1fe6e4f","modified":"2018-08-27","parentfolderid":"root","subordinate":0},{"created":"2018-09-10","creater":"admin","folderid":"002","foldername":"国益大厦租务部","id":"a20cb97b87854355b263e66b62189ad4","modified":"2018-09-10","parentfolderid":"root","subordinate":0},{"created":"2018-09-11","creater":"admin","folderid":"003","foldername":"系统运维","id":"e9c393dadf5e49e7b5b30975a991fdf3","modified":"2018-09-12","parentfolderid":"root","subordinate":0},{"created":"2018-09-12","creater":"admin","folderid":"004","foldername":"金泰大厦租务部","id":"456b238ea5a54368b0dfe174b2deafbc","modified":"2018-09-12","parentfolderid":"root","subordinate":3},{"created":"2018-11-15","creater":"admin","folderid":"004001","foldername":"能+空间（金泰）","id":"1c19db975d0f4562a29ec5ccdec90459","modified":"2018-11-15","parentfolderid":"456b238ea5a54368b0dfe174b2deafbc","subordinate":0},{"created":"2018-11-15","creater":"admin","folderid":"004002","foldername":"运维人员","id":"1ec586dfd7624190bc1061b6845e9f94","modified":"2018-11-15","parentfolderid":"456b238ea5a54368b0dfe174b2deafbc","subordinate":0},{"created":"2018-11-15","creater":"admin","folderid":"004003","foldername":"金泰财务部","id":"341b466efeb54dbe9ebac2f9ea07b0cd","modified":"2018-11-15","parentfolderid":"456b238ea5a54368b0dfe174b2deafbc","subordinate":0}];
			layui.use(['table'],function(){
				var table = layui.table;
				//第一个实例
				  table.render({
					elem: '#list'
					,height: '300'
					,url: '' //数据接口
					,page: true //开启分页
					,cols: [[ //表头
					  	{
					  		field: 'xh',
					  		title: '序号',
					  		width: 80,
					  		align: 'center',
					  		templet: function(d) {
					  			return d.LAY_INDEX;
					  		}
					  	}, {
					  		field: 'foldername',
					  		title: '组织名称',
					  		align: 'center'
					  	}, {
					  		field: 'folderid',
					  		title: '层级编号',
					  		align: 'center'
					  	}, {
					  		field: 'opt',
					  		title: '操作',
					  		width: 160,
					  		align: 'center',
					  		templet: function(d) {
					  			return `<a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>编辑</a>
					  					  &nbsp;<a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>`
					  		}
					  	}
					]]
					,data:data
				  });
			})
			$(function(){
				$("#addBtn").click(function(){
					openLayer('dept_add.html','组织新增','600px','300px');
				})
			})
		</script>
	</body>
</html>
